package cn.gaotu.org.domain;

import cn.gaotu.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ZouX
 * @date 2022/8/10 14:50
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department extends BaseDomain {

    //部门编号
    private String sn;
    //部门名称
    private String name;
    //部门状态:1-启用,0禁用
    private Integer state;
    //部门经理的ID 对应t_employee
    private Long manager_id;
    private Employee manager;
    //上级部门ID--对应t_department
    private Long parent_id;
    private Department parent;
    //用来保存当前部门的子部门，属性名要于elementUi组件中的属性一致，不能改
    //部门树最后一级没有数据就不显示
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList<>();
}
